package com.zqj.spring_mybatis.userInfo.controller;

import com.zqj.spring_mybatis.userInfo.pojo.UserInfo;
import com.zqj.spring_mybatis.userInfo.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userInfo")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;


    @RequestMapping("/test")
    public String test(){
        return "test";
    }


    @RequestMapping("/addUser")
    @ResponseBody
    public UserInfo addUser(UserInfo userInfo){

        UserInfo userInfoDB = null;

        try {
            userInfoService.addUser(userInfo);

        }catch (Exception e){
            e.printStackTrace();
        }


        return userInfoDB;
    }


}
